

  
<table class="table table-hover">
  <thead>
    <tr>
      <th>ID</th>
      <th>名称</th>
      <th>开始时间</th>
      <th>结束时间</th>
      <th>限购数量</th>
      <th>是否结束</th>
      <th>状态</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <foreach name="microSeckill" item="vo">
    <tr class="vo-tr"> 
      <td class="vo-id">{$vo.id}</td>
      <td>{$vo.name}</td>
      <td>{$vo.start_time}</td>
      <td>{$vo.end_time}</td>
      <td>{$vo.daily_number}</td>
      <td >{$vo["expired"]?"活动已结束":"活动未结束"}</td>
     <td class="status">{$vo["status"]?"可用":"禁用"}</td>
      <td>
       <a class="btn btn-primary btn-xs" href="{:U('MicroTheme/index',array('model'=>'microSeckill','id'=>$vo['id']))}">主题设置</a>
        <a class="btn btn-primary btn-xs" href="javascript:void(0)" id="copy-home-url-{$vo.id}" data-url="{$vo.url}">前台地址</a>
        <a class="btn btn-primary btn-xs" href="{:U('MicroSeckillApply/index',array('id'=>$vo['id']))}">申请者信息</a>
        <a class="btn btn-primary btn-xs" href="__CONTROLLER__/modify/id/{$vo.id}">修改</a>
        <a class="btn btn-danger btn-xs actionds" data-action-id="{$vo.id}" data-action-txt="移除中……" data-action-url="__CONTROLLER__/remove">移除</a>
        <a class="btn btn-info btn-xs action-status" data-action-id="{$vo.id}" data-action-txt="执行中……" data-action-status="{$vo.status}" data-action-status-txt="可用 禁用" data-action-url="__CONTROLLER__/setStatus">{$vo["status"]?"禁用":"可用"}</a>
      </td>
    </tr>
    </foreach>
  </tbody>
</table>
<div class="pagination">{$pagination}</div>
<script src="__PUBLIC__/Style/Common/js/ZeroClipboard.js"></script>
<script type="text/javascript">
  $(function(){
        $(".vo-tr").each(function(i){
        	 $().copyPaste({
                 text: $("#copy-home-url-"+$(".vo-id").eq(i).html()).attr("data-url"),
                 id:  $("#copy-home-url-"+$(".vo-id").eq(i).html()).attr("id")
               });
        })
       
       
    $( ".table" ).delegate( ".audit", "change", function(){
      var status = $( this ).val(),
          id = $( this ).attr( "data-id" );
      $.post ( "__CONTROLLER__/setStatus", { "id": id, "status": status}, function(data){
        if( data.error ) {
          $().alertMsg( { "type": "error", "msg": data.msg } );
        } else {
          $().alertMsg( { "type": "success", "msg": data.msg } );
        };
      });
    });
  });
</script>
